# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html.
# For more examples on how to use CMake, see https://github.com/android/ndk-samples.

cmake_minimum_required(VERSION 3.22.1)

project("compression")

#添加lib，SHARED类型，是IMPORTED 引入的库
add_library(libjpeg
        SHARED
        IMPORTED)

#设置 库的属性   里面是名称 ，属性：引入地址把我们的真实地址填写进去
set_target_properties(libjpeg
        PROPERTIES
        IMPORTED_LINK_INTERFACE_LIBRARIES ""
        IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/libs/${ANDROID_ABI}/libjpeg.so"
        )

#添加lib，SHARED类型，是IMPORTED 引入的库
add_library(libturbojpeg
        SHARED
        IMPORTED)

#设置 库的属性   里面是名称 ，属性：引入地址把我们的真实地址填写进去
set_target_properties(libturbojpeg
        PROPERTIES
        IMPORTED_LINK_INTERFACE_LIBRARIES ""
        IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/libs/${ANDROID_ABI}/libturbojpeg.so"
        )


add_library(${CMAKE_PROJECT_NAME} SHARED
        compression.cpp)

target_link_libraries(${CMAKE_PROJECT_NAME}
        android
        libjpeg
        -ljnigraphics
        libturbojpeg)

